#ifndef _ABACUSIM_CLOCK_H_
#define _ABACUSIM_CLOCK_H_

/* The callback function Clock should drive the core */
struct _core;
typedef void (*Clock)(struct _core* core);

typedef struct _core {
	/* TODO represent code and memory as connected to some bus */
	char* code;
	char* memory;

	unsigned int regfile[32];
	unsigned int reg_pc;
	int halted;
	Clock clock;
} Core;

extern void init_core(Core* core, char* memory, size_t code_start);
extern inline int halted(Core* core);

#endif	/* _ABACUSIM_CLOCK_H_ */
